import launch
import launch_ros
from ament_index_python.packages import get_package_share_directory
import os


def generate_launch_description():
    #获取config 文件夹:patrol_config.yaml 配置坐标点文件
    autopatrol_robot_path = get_package_share_directory('autopatrol_robot')
    default_patrol_config_path = os.path.join(autopatrol_robot_path, 'config', 'patrol_config.yaml')

     #启动patrol_node节点,
    action_autopatrol_robot = launch_ros.actions.Node(
        package='autopatrol_robot',
        executable ='patrol_node',
        output='screen',
        parameters =[default_patrol_config_path]
    )
   
    #speaker节点
    action_speaker_node = launch_ros.actions.Node(
        package='autopatrol_robot',
        executable ='speaker', 
        output='screen',
            
    )

    return launch.LaunchDescription([
        action_autopatrol_robot,
        action_speaker_node
    ])